using Xunit;

namespace Sustainalytics.Portfolios.BL.Tests.UnitTest
{
    [Trait("Category", "Unit")]
    public class PortfolioImportResultTest
    {
        public static int TotalNumber = 3;
        readonly PortfolioImportResult _sut = new PortfolioImportResult(TotalNumber);

        [Fact]
        public void Validate_No_Match_Text()
        {
            //arrange
            _sut.NumberOfUnmatchedRows = 3;
            _sut.NumberOfCorrectMatches = 0;

            var actual = _sut.MatchingSummary;
            Assert.Equal("No matches found for the uploaded securities.", actual);

        }

        [Fact]
        public void Validate_All_Successfully_Matched_Text()
        {
            _sut.NumberOfUnmatchedRows = 0;
            _sut.NumberOfCorrectMatches = 3;



            var actual = _sut.MatchingSummary;
            Assert.Equal("All securities successfully matched", actual);
        }


        [Fact]
        public void Validate_Some_Matched_Text()
        {
            _sut.NumberOfUnmatchedRows = 2;
            _sut.NumberOfCorrectMatches = 1;



            var actual = _sut.MatchingSummary;
            Assert.Equal("1 securities successfully matched <br /> 2 securities not matched", actual);
        }

    }
}